package Irc;

// HelloServer.java
// Copyright and License 

import com.sun.corba.se.spi.activation.Server;
import java.util.*;
import java.io.*;
import java.rmi.*;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;


/**
 * Cette classe est la classe principale constituant le programme serveur de forum. 
 * Cette classe repr�sente le serveur du forum. Elle initialise l'orb 
 * et l'objet servant du forum (ForumImpl).
 */
 

public class ForumServer{

    private static ForumImpl forumImpl;
    
 public static void main(String args[]){

   int status = 0;

   try {	
   	ForumImpl forum = new ForumImpl();
        Forum forumStub = (Forum) UnicastRemoteObject.exportObject(forum, 0);
        ForumServer.forumImpl = new ForumImpl();
        LocateRegistry.createRegistry(1099);
        Registry registry = LocateRegistry.getRegistry();
        registry.bind("Forum", forumStub);

   } catch(Exception ex) {
 		ex.printStackTrace();
 		status = 1;
   }

 }
 
}
